#ifndef _BUOLA_GL_FUNCTIONS_H_
#define _BUOLA_GL_FUNCTIONS_H_

#include <buola/image/ccolor.h>
#include <buola/mat/transformations.h>

namespace buola { namespace gl {

inline void viewport(const CRect_d &pRect)
{
    glViewport((int)pRect.l,(int)pRect.t,(int)pRect.w(),(int)pRect.h());
}

inline void scissor(const CRect_d &pRect)
{
    glScissor((int)pRect.l,(int)pRect.t,(int)pRect.w(),(int)pRect.h());
}

inline void vertex_attrib(GLuint pIndex,const img::CColor &pColor)
{
    glVertexAttrib4d(pIndex,pColor.r,pColor.g,pColor.b,pColor.a);
}

inline void clear_color(const img::CColor &pColor)
{
    glClearColor((GLclampf)pColor.r,(GLclampf)pColor.g,(GLclampf)pColor.b,(GLclampf)pColor.a);
}

inline void vertex_attrib(GLuint pIndex,const CPoint_d &pPoint)
{
    glVertexAttrib2d(pIndex,pPoint.x,pPoint.y);
}

inline void vertex_attrib(GLuint pIndex,const mat::CVec3d &pVector)
{
    glVertexAttrib3d(pIndex,pVector.x(),pVector.y(),pVector.z());
}

/*namespace gl*/ } /*namespace buola*/ }

#endif
